<style type="text/css">
    #region_address .n-error{
        margin-left: 250px;
    }
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><a style="color: red">*</a>{:__('Avatar')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-avatar" class="form-control" data-rule="required" data-msg-required="  " placeholder="請上傳圖片" size="50" name="row[avatar]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-avatar" class="btn btn-danger faupload" data-maxsize="3M" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-avatar"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-avatar"></ul>
        </div>
        <label style="
    padding-top: 4px;
    padding-left: 4px;">請上傳圖片</label>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><a style="color: red">*</a>{:__('Nickname')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-nickname" data-rule="required;length(~20)" class="form-control" name="row[nickname]" type="text" value="" placeholder="請填寫員工姓名" >
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><a style="color: red">*</a>{:__('Username')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-username" data-rule="required;length(~20)" class="form-control" name="row[username]" type="text" value="" placeholder="請填寫賬號">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><a style="color: red">*</a>{:__('Bright_password')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-bright_password" data-rule="required;length(~20)" class="form-control" name="row[bright_password]" type="text" value="" placeholder="請填寫密碼">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><a style="color: red">*</a>{:__('Region_address')}:</label>
        <div class="row">
            <div class="col-xs-9" id="region_address">
                <div class="form-inline" data-toggle="cxselect" data-selects="province,city">
                    <select  data-rule="required" class="province form-control" name="province" data-url="area/area">
                    </select>
                    <select  data-rule="required" class="city form-control" name="city" data-url="area/area">
                    </select>
                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><a style="color: red">*</a>用戶:</label>
        <div class="col-xs-12 col-sm-8">
        <a data-url="user/user/indexs" href="javascript:;"  class="btn btn-success spec_add_btn" data-title="選擇用戶" >分配用戶</a>
        </div>
    </div>
    <div class="form-group" id="tag_f_div" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">已選擇用戶:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="tag_div" id="tag_div">
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><a style="color: red">*</a>義工:</label>
        <div class="col-xs-12 col-sm-8">
        <a data-url="volunteer/indexs" href="javascript:;"  class="btn btn-success spec_adds_btn" data-title="分配義工" >分配義工</a>
        </div>
    </div>
    <div class="form-group" id="tag_f_divs" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">已選擇用義工:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="tag_divs" id="tag_divs">
            </div>
        </div>
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script type="text/javascript">
    
    function removeParent(obj){
        $(obj).parent().remove();
        if ( $(".tag").length == 0 ) {
            $("#tag_f_div").hide();
        }else{
            $("#tag_f_div").show();
        }
    }
    function removeParents(obj){
        $(obj).parent().remove();
        if ( $(".tags").length == 0 ) {
            $("#tag_f_divs").hide();
        }else{
            $("#tag_f_divs").show();
        }
    }
</script>